<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreateRelativeRelation extends Migrator
{
    public function up(){
        $table = $this->table('relative_relation',['comment'=>'亲属关系表']);
        $table->addColumn('accid','string',['limit'=>32,'comment'=>'用户accid'])
            ->addColumn('faccid','string',['limit'=>32,'comment'=>'好友accid'])
            ->addColumn('relation','text',['comment'=>'关系json'])
            ->addColumn('create_time','string',['limit'=>10,'default'=>time(),'comment'=>'创建时间'])
            ->addColumn('update_time','string',['limit'=>10,'default'=>time(),'comment'=>'更新时间'])
            ->create();
    }
    public function down(){
        $this->dropTable('relative_relation');
    }
}
